/****************************************************************************
 *   FileName    : TCC_IoctlCode.h
 *   Description : 
 ****************************************************************************
 *
 *   TCC Version 1.0
 *   Copyright (c) Telechips, Inc.
 *   ALL RIGHTS RESERVED
 *
 ****************************************************************************/
#ifndef __TCC_IOCLTCODE_H__
#define __TCC_IOCLTCODE_H__

#include <windows.h>
#include <Winioctl.h>

#ifdef __cplusplus
extern "C" {
#endif

#define	IOCTL_HAL_TCCCKC	CTL_CODE(FILE_DEVICE_HAL, 1000, METHOD_BUFFERED, FILE_ANY_ACCESS)

#define OLD_TCC_IOCTLCode(f,m)  CTL_CODE ( FILE_DEVICE_UNKNOWN, 0x400 | (f), (m), FILE_ANY_ACCESS )
#define IOCTL_I2C_INIT_OLD                   OLD_TCC_IOCTLCode(30, METHOD_BUFFERED)
#define IOCTL_I2C_OPEN_OLD                   OLD_TCC_IOCTLCode(31, METHOD_BUFFERED)
#define IOCTL_I2C_CLOSE_OLD                  OLD_TCC_IOCTLCode(32, METHOD_BUFFERED)
#define IOCTL_I2C_READ_OLD                   OLD_TCC_IOCTLCode(33, METHOD_BUFFERED)
#define IOCTL_I2C_WRITE_OLD                  OLD_TCC_IOCTLCode(34, METHOD_BUFFERED)

#define TCC_IOCTLCode(f,m)  CTL_CODE ( FILE_DEVICE_UNKNOWN , 0xA00 + (f), (m), FILE_ANY_ACCESS )

/*******************************************
         NAND Controller IOCTL CODE
********************************************/
#define DISK_HD_WRITE					TCC_IOCTLCode(1,METHOD_BUFFERED)
#define DISK_HD_READ					TCC_IOCTLCode(2,METHOD_BUFFERED)
#define DISK_FW_UPDATE					TCC_IOCTLCode(3,METHOD_BUFFERED)
#define DISK_GET_SERIALNUM				TCC_IOCTLCode(4,METHOD_BUFFERED)
#define DISK_MULTI_HD_WRITE				TCC_IOCTLCode(5,METHOD_BUFFERED)
#define DISK_MULTI_HD_READ				TCC_IOCTLCode(6,METHOD_BUFFERED)
#define DISK_GET_BOOTCRCCODE			TCC_IOCTLCode(7,METHOD_BUFFERED)
#define DISK_GET_MAX_SECTOR_PER_BLOCK	TCC_IOCTLCode(8,METHOD_BUFFERED)

#define DISK_GET_IOCTL_TEST				TCC_IOCTLCode(9,METHOD_BUFFERED)


/*******************************************
         FMM Controller IOCTL CODE
********************************************/
#if defined(_FMT_)
#define IOCTL_FMT_ENABLE				TCC_IOCTLCode(200, METHOD_BUFFERED)
#define IOCTL_FMT_DISABLE				TCC_IOCTLCode(201, METHOD_BUFFERED)
#define IOCTL_FMT_SETFREQ				TCC_IOCTLCode(202, METHOD_BUFFERED)
#define IOCTL_FMT_GETTEBSTAT			TCC_IOCTLCode(203, METHOD_BUFFERED)
#define IOCTL_FMT_GETFREQ				TCC_IOCTLCode(204, METHOD_BUFFERED)
#define IOCTL_FMT_SETTXLEVEL			TCC_IOCTLCode(205, METHOD_BUFFERED)
#define IOCTL_FMT_GETREG				TCC_IOCTLCode(206, METHOD_BUFFERED)
#define IOCTL_FMT_SETINIT				TCC_IOCTLCode(207, METHOD_BUFFERED)
#else defined(_FMM_SI47XX_)/* SI47XX */
#define IOCTL_FMTR_PWR_ON				TCC_IOCTLCode(200,  METHOD_BUFFERED)
#define IOCTL_FMTR_PWR_OFF				TCC_IOCTLCode(201,  METHOD_BUFFERED)
#define IOCTL_FMT_SETFREQ				TCC_IOCTLCode(202,  METHOD_BUFFERED)
#define IOCTL_FMT_GET_TX_VOLTAGE_LEVEL	TCC_IOCTLCode(203,  METHOD_BUFFERED)
#define IOCTL_FMT_GETFREQ				TCC_IOCTLCode(204,  METHOD_BUFFERED)
#define IOCTL_FMT_SET_TX_VOLTAGE_LEVEL	TCC_IOCTLCode(205,  METHOD_BUFFERED)
#define IOCTL_FMT_MODE					TCC_IOCTLCode(206,  METHOD_BUFFERED)
#define IOCTL_FMT_SETINIT				TCC_IOCTLCode(207,  METHOD_BUFFERED)
#define IOCTL_FMR_TUNE_FREQ				TCC_IOCTLCode(209,  METHOD_BUFFERED)
#define IOCTL_FMR_TUNE_STATUS_RSSI		TCC_IOCTLCode(210, METHOD_BUFFERED)
#define IOCTL_FMR_TUNE_STATUS_SNR		TCC_IOCTLCode(211, METHOD_BUFFERED)
#define IOCTL_FMR_GETFREQ				TCC_IOCTLCode(212, METHOD_BUFFERED)
#endif
#define IOCTL_MODE_FMR_ON				TCC_IOCTLCode(213, METHOD_BUFFERED)
#define IOCTL_MODE_FMR_OFF				TCC_IOCTLCode(214, METHOD_BUFFERED)

/*******************************************
         PMU Controller IOCTL CODE
********************************************/
#define IOCTL_PMU_SETINIT				TCC_IOCTLCode(300, METHOD_BUFFERED)
#define IOCTL_PMU_SETCORE				TCC_IOCTLCode(301, METHOD_BUFFERED)
#define IOCTL_PMU_SETIO				TCC_IOCTLCode(302, METHOD_BUFFERED)
#define IOCTL_PMU_SETMEM				TCC_IOCTLCode(303, METHOD_BUFFERED)
#define IOCTL_PMU_SETSWLED			TCC_IOCTLCode(304, METHOD_BUFFERED)
#define IOCTL_PMU_GETREG				TCC_IOCTLCode(305, METHOD_BUFFERED)
#define IOCTL_PMU_SETREG				TCC_IOCTLCode(306, METHOD_BUFFERED)
#define IOCTL_PMU_INITCHG				TCC_IOCTLCode(307, METHOD_BUFFERED)
#define IOCTL_PMU_STARTTCHG			TCC_IOCTLCode(308, METHOD_BUFFERED)
#define IOCTL_PMU_SUSPENDTCHG			TCC_IOCTLCode(309, METHOD_BUFFERED)

/*******************************************
         I2C Controller IOCTL CODE
********************************************/
#define IOCTL_I2C_INIT                   TCC_IOCTLCode(500, METHOD_BUFFERED)
#define IOCTL_I2C_OPEN                   TCC_IOCTLCode(501, METHOD_BUFFERED)
#define IOCTL_I2C_CLOSE                  TCC_IOCTLCode(502, METHOD_BUFFERED)
#define IOCTL_I2C_READ                   TCC_IOCTLCode(503, METHOD_BUFFERED)
#define IOCTL_I2C_WRITE                  TCC_IOCTLCode(504, METHOD_BUFFERED)

/*******************************************
         TVOUT Controller IOCTL CODE
********************************************/
#define IOCTL_TVOUT_TYPE				TCC_IOCTLCode(600, METHOD_BUFFERED)
#define IOCTL_TVOUT_OPEN				TCC_IOCTLCode(601, METHOD_BUFFERED)
#define IOCTL_TVOUT_CLOSE				TCC_IOCTLCode(602, METHOD_BUFFERED)


/*******************************************
         Camera Interface Controller IOCTL CODE
********************************************/
#define	IOCTL_CIF_PORTINITIALIZE		TCC_IOCTLCode(700, METHOD_BUFFERED)
#define	IOCTL_CIF_PREVIEWCONFIG			TCC_IOCTLCode(701, METHOD_BUFFERED)
#define	IOCTL_CIF_CAPTURECONFIG			TCC_IOCTLCode(702, METHOD_BUFFERED)
#define	IOCTL_CIF_STARTCAPTURE			TCC_IOCTLCode(703, METHOD_BUFFERED)
#define	IOCTL_CIF_FUNCTIONCONTROL		TCC_IOCTLCode(704, METHOD_BUFFERED)
#define	IOCTL_CIF_SETEFFECT				TCC_IOCTLCode(705, METHOD_BUFFERED)
#define	IOCTL_CIF_STARTOPERATING		TCC_IOCTLCode(706, METHOD_BUFFERED)
#define	IOCTL_CIF_STOPOPERATING			TCC_IOCTLCode(707, METHOD_BUFFERED)

#define	IOCTL_CAM_STARTPREVIEW			TCC_IOCTLCode(710, METHOD_BUFFERED)
#define	IOCTL_CAM_STOPPREVIEW			TCC_IOCTLCode(711, METHOD_BUFFERED)
#define	IOCTL_CAM_STARTCAPTURECAMERA	TCC_IOCTLCode(712, METHOD_BUFFERED)
#define	IOCTL_CAM_CONTINUEPREVIEW		TCC_IOCTLCode(713, METHOD_BUFFERED)
#define	IOCTL_CAM_EFFECT				TCC_IOCTLCode(714, METHOD_BUFFERED)

#define	IOCTL_MODULE_INIT				TCC_IOCTLCode(720, METHOD_BUFFERED)
#define	IOCTL_MODULE_PREVIEW			TCC_IOCTLCode(721, METHOD_BUFFERED)
#define	IOCTL_MODULE_CAPTURE			TCC_IOCTLCode(722, METHOD_BUFFERED)
#define	IOCTL_MODULE_MODE				TCC_IOCTLCode(723, METHOD_BUFFERED)





/*******************************************
         Backlight Controller IOCTL CODE
********************************************/
#define IOCTL_BLK_GETPOWER				TCC_IOCTLCode(800, METHOD_BUFFERED)
#define IOCTL_BLK_SETPOWER				TCC_IOCTLCode(801, METHOD_BUFFERED)


/*******************************************
         SDMMC IOCTL CODE
********************************************/
#define IOCTL_SD_STATE					TCC_IOCTLCode(900, METHOD_BUFFERED)
#define IOCTL_SD_GET_HIDDENINFO			TCC_IOCTLCode(901, METHOD_BUFFERED)



#ifdef __cplusplus
}
#endif

#endif /* __TCC_IOCLTCODE_H__ */

